﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data;
using Com.Crc.PoJo.Model.UserBoard;
using Com.Crc.ResManage.DAL.EquipManage;

namespace Com.Crc.ResManage.BLL.EquipManage
{
    public class PONManageUserBoardBLL
    {
        PONManageUserBoardDAL dal = new PONManageUserBoardDAL();

        /// <summary>
        /// 新增PON用户板信息
        /// </summary>
        /// <param name="data">model实体</param>
        /// <returns></returns>
        public bool AddOLTUserBoardData(PONUserBoardEntity data)
        {
            try
            {
                return dal.AddPONUserBoardData(data);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return false;
            }
        }

        /// <summary>
        /// 修改PON用户板信息
        /// </summary>
        /// <param name="data">model实体</param>
        /// <returns></returns>
        public bool UpdateOLTUserBoardData(PONUserBoardEntity data)
        {
            try
            {
                return dal.UpdatePONUserBoardData(data);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return false;
            }
        }

        /// <summary>
        /// 查询PON用户板信息
        /// </summary>
        /// <param name="strBranchID">分局ID</param>
        /// <param name="strOfficeID">局点ID</param>
        /// <param name="strOltID">OLT设备ID</param>
        /// <param name="strUserBoardID">用户板ID</param>
        /// <returns></returns>
        public DataTable QueryOLTUserBoardData(string strBranchID, string strOfficeID, string strOltID, string strUserBoardID)
        {
            try
            {
                return dal.QueryPONUserBoardData(strBranchID, strOfficeID, strOltID, strUserBoardID);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return null;
            }
        }

        /// <summary>
        /// 删除设备下面的用户板
        /// </summary>
        /// <param name="OLTList"></param>
        /// <returns></returns>
        public bool DeleteOLTUserBoardData(ArrayList userboardList)
        {
            try
            {
                return dal.DeletePONUserBoardData(userboardList);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return false; ;
            }
        }
    }
}
